// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   PageResultUtil.java

package com.ronglian.register_mini_program.util;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.ronglian.register_mini_program.model.web.PageResult;

import java.util.List;

public class PageResultUtil {

    public PageResultUtil() {
    }

    public static PageResult getPageResult(List list) {
        PageResult pageResult = new PageResult();
        if (list instanceof Page) {
            PageInfo pageInfo = new PageInfo(list);
            pageResult.setDataList(pageInfo.getList());
            pageResult.setPageNum(pageInfo.getPageNum());
            pageResult.setPages(pageInfo.getPages());
            pageResult.setTotal(pageInfo.getTotal());
            pageResult.setPageSize(pageInfo.getPageSize());
        }
        return pageResult;
    }
}
